import myaxios from "../utils/request";
export function index_banner(payload = {}) {
    return myaxios.get('/index/banner', { params: payload })
}
//推荐列表
export function index_goodlist(payload = {}) {
    return myaxios.get('/index/goodlist', { params: payload })
}
// 导航 -/api/index/nav (get)
export function index_nav(payload = {}) {
    return myaxios.get('/index/nav', { params: payload })
}
// 分类/api/category/list(get)
export function category_list(payload = {}) {
    return myaxios.get('/category/list', { params: payload })
}
// 二级分类/api/category/subcate(get)
export function category_subcate(payload = {}) {
    return myaxios.get('/category/subcate', { params: payload })
}
// 导航/api/user/login
export function user_login(data) {
    return myaxios.post('/user/login', data)
}
// 注册/api/user/register
export function user_register(data) {
    return myaxios.post('/user/register', data)
}
// 三级分类下的列表页面/api/good/list
export function good_list(payload = {}) {
    return myaxios.get('/good/list', { params: payload })
}
// 详情页面
export function good_goodinfo(payload = {}) {
    return myaxios.get('good/goodinfo', { params: payload })
}
// 主页轮播图index/banner
// export function index_banner(payload = {}) {
//     return myaxios.get('index/banner', { params: payload })
// }
//购物车列表页面shopcart/list
export function shopcart_list(payload = {}) {
    return myaxios.get('shopcart/list', { params: payload })
}
//收藏/api/good/fav
// userid 用户id 必须传 , goodid 商品id 必须传
export function good_fav(data) {
    return myaxios.post('good/fav', data)
}
//加入购物车/api/shopcart/add
export function shopcart_add(data) {
    return myaxios.post('shopcart/add', data)
}
//收藏列表good/favlist
export function good_favlist(payload = {}) {
    return myaxios.get('good/favlist', { params: payload })
}
//取消收藏good_unfav
export function good_unfav(data) {
    return myaxios.post('good/unfav', data)
}
//清空购物车
export function shopcart_clear(data) {
    return myaxios.post('shopcart/clear', data)
}
//购物车数量减一
export function shopcart_sub(data) {
    return myaxios.post('shopcart/sub', data)
}
//按关键词搜索
export function good_search(payload = {}) {
    return myaxios.get('good/search', { params: payload })
}
//热门搜索
export function good_hotsearch(payload = {}) {
    return myaxios.get('good/hotsearch', { params: payload })
}